home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Classes / DE_SerialSolutions2.0 / MiniSerial1<2.0 demo> / Controller.m < prev    next >
Encoding:
Text File  |  1992-08-19  |  441 b   |  39 lines

  1.  
  2. #import "Controller.h"
  3. #import <appkit/appkit.h>
  4. #import "../SerialAndModem/Serial.h"
  5.  
  6. @implementation Controller
  7.  
  8. - init
  9. {
  10.     [super init];
  11.     
  12.     mySerial = [[Serial alloc] init];
  13.     [mySerial openRAW:"/dev/cua" Baudrate:9600];
  14.     [mySerial dropDTR];
  15.  
  16.     return self;
  17. }
  18.  
  19. - changeDTR:sender
  20. {
  21.     static int    state = 0;
  22.     
  23.     if(state == 0) 
  24.     {
  25.         [mySerial raiseDTR];
  26.         state = 1;
  27.     }    
  28.     else
  29.     {
  30.         [mySerial dropDTR];
  31.         state = 0;
  32.     }
  33.     
  34.     return self;
  35. }    
  36.  
  37.  
  38. @end
  39.